tmpdir="@KEDR_TEST_PREFIX_TEMP_SESSION@/kedr_fsim_final_template_no_fpoint_params"
payload_fsim="@kmodule_name@.ko"

test_function()
{
	# Whether fault simulation point is created
	if ! test -d "${fault_simulation_points_dir}/__kmalloc"; then
		printf "Fault simulation point '__kmalloc' is not created.\n"
		return 1
	fi

	# Whether fault simulation point has correct format string
	format_string=`cat "${fault_simulation_points_dir}/__kmalloc/format_string"`
	if test "${format_string}" != ""; then
		printf "Fault simulation point '__kmalloc' has format string '%s', but should has '%s'.\n" "${format_string}" ""
		return 1
	fi

	# Verify that "normal" execution of the function is as expected.
	if ! trigger_function "__kmalloc" "10"; then
		printf "Normal execution of __kmalloc fails, but should not.\n"
		return 1
	fi

	# Verify that "fault" execution of the function is as expected.
	if ! echo "${indicator_constant_name}" "1" > "${fault_simulation_points_dir}/__kmalloc/current_indicator"; then
		printf "Fail to set indicator for fault simulation point '__kmalloc'.\n"
		return 1
	fi

	if trigger_function "__kmalloc" "10"; then
		printf "Execution of __kmalloc should fail(because of indicator), but it doesn't.\n"
		return 1
	fi
}